/// @tags: DP with MonotoneStack ConvexOptimization
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>

using std::cin;
using std::cout;
using std::max;
using std::min;

namespace BlueQuantum {

constexpr int MAXN = 1e5 + 3;

int n, head, tail, h[MAXN];
double ans1[MAXN], ans2[MAXN];

struct Node {
  int l, r, x;
} sta[MAXN];

inline double calc(int i, int j) { return h[j] + sqrt(i - j); }

inline int bound(int i, int j) {
  int l = max(i, j), r = n, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    calc(mid, i) >= calc(mid, j) ? (ans = mid, l = mid + 1) : r = mid - 1;
  }
  return ans;
}

inline void Solve(double p[]) {
  sta[head = tail = 1] = Node{1, n, 1};
  for (int i = 2; i <= n; ++i) {
    while (head < tail && sta[head].r < i) ++head;
    p[i] = calc(i, sta[head].x);
    if (calc(n, i) <= calc(n, sta[tail].x)) continue;
    while (head < tail && calc(sta[tail].l, sta[tail].x) <= calc(sta[tail].l, i)) --tail;
    sta[tail].r = bound(sta[tail].x, i);
    tail++;
    sta[tail] = Node{sta[tail - 1].r + 1, n, i};
  }
}

inline int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> h[i];
  Solve(ans1);
  std::reverse(h + 1, h + n + 1);
  Solve(ans2);
  std::reverse(h + 1, h + n + 1);
  for (int i = 1; i <= n; ++i)
    cout << max(0, (int)ceil(max(ans1[i], ans2[n - i + 1])) - h[i]) << '\n';
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P5503 [JSOI2016] 灯塔.in", "r", stdin);
  freopen("P5503 [JSOI2016] 灯塔.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
